<?php

App::uses('AppModel', 'Model');

/**
 * BannersHasPagina Model
 *
 * @property Banners $Banners
 * @property Paginas $Paginas
 */
class BannersHasPagina extends BannersAppModel {
    
    public $table = 'banners_has_paginas';

    public $actsAs = array('Search.Searchable');
    public $filterArgs = array(
        'id' => array('type' => 'value'),
        'banners_id' => array('type' => 'value'),
        'pagians_id' => array('type' => 'value'),
    );

    /**
     * Validation rules
     *
     * @var array
     */
    public $validate = array(
        'banners_id' => array(
            'numeric' => array(
                'rule' => array('numeric'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'paginas_id' => array(
            'numeric' => array(
                'rule' => array('numeric'),
            //'message' => 'Your custom message here',
            //'allowEmpty' => false,
            //'required' => false,
            //'last' => false, // Stop validation after this rule
            //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed

    /**
     * belongsTo associations
     *
     * @var array
     */
    public $belongsTo = array(
        'Banner' => array(
            'className' => 'Banner',
            'foreignKey' => 'banners_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        ),
        'Pagina' => array(
            'className' => 'Pagina',
            'foreignKey' => 'paginas_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
    );

}
